#light

open System
open Xunit
open FsxUnit.Syntax

module XUnitTests =

  [<Fact>]
  let true_value_should_be_True() =
    true |> should be True
  
  [<Fact>]
  let false_value_should_be_False() =
    false |> should be False
  
  [<Fact>]
  let empty_collection_should_be_Empty() =
    [] |> should be Empty

  [<Fact>]
  let ten_item_collection_should_be_Not_Empty() =
    [1..10] |> should be NonEmpty
  
  [<Fact>]
  let null_item_should_be_Null() =
    null |> should be Null
  
  [<Fact>]
  let non_null_item_should_be_Not_Null() =
    "foo" |> should be NonNull  

  [<Fact>]
  let equal_value_should_be_equal() =
    "foo" |> should equal "foo"

  [<Fact>]
  let inequal_value_should_not_be_equal() =
    "foo" |> should not_equal "bar"  

  [<Fact>]
  let ten_item_collection_should_have_three() =
    [1..10] |> should have 3

  [<Fact>]
  let ten_item_collection_should_not_have_twentyfive() =
    [1..10] |> should not_have 25

  [<Fact>]
  let foobar_should_contain_foo() =
    "foobar" |> should contain "foo"
  
  [<Fact>]
  let foobar_should_not_contain_hello() =
    "foobar" |> should not_contain "hello"
  
  let throwsException() : unit =
    raise(ArgumentException "Bad things!")
  
  let doesntThrowException() : unit =
    printfn "Hello World!"  

  [<Fact>]
  let throwsException_should_throw_exception() =
    throwsException |> should (throw_exception<ArgumentException>)
  
  [<Fact>]
  let doesntThrowException_should_not_throw_exception() =
    doesntThrowException |> should not_throw_exception

  [<Fact>]
  let value_in_range_should_be_in_range() =
    2 |> should be_in_range 0 100
  
  [<Fact>]
  let value_not_in_range_should_not_be_in_range() =
    200 |> should not_be_in_range 0 100
  
  [<Fact>]
  let same_values_should_be_the_same() =
    let foo = "foo"
    foo |> should be_same_as foo
  
  [<Fact>]
  let different_values_should_not_be_the_same() =
    let foo = "foo"
    let bar = "bar"
    foo |> should not_be_same_as bar
  
  [<Fact>]
  let assignable_from_should_be_assignable_from() =
    "foo" |> should be_assignable_from (typeof<string>)